# -*- coding: utf-8 -*-
# @Time    : 2021/11/21 13:49
# @Author  : super

import yaml

class YamlClass():
	def __init__(self, file_name, file_modul):
		self.file_name = file_name
		self.file_modul = file_modul

	def __enter__(self):
		self.f = open(self.file_name, self.file_modul)
		return self.f

	def __exit__(self, exc_type, exc_val, exc_tb):
		self.f.close()

if __name__ == '__main__':
    with YamlClass("student.yaml","r") as f:
	    print(yaml.safe_load(f))